<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>设置优先角色</title>
<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5.4.2/themes/icon.css"/>
<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5.4.2/themes/black/easyui.css"/>
<link rel="stylesheet" type="text/css" href="css/taojin/layout.css">
<link rel="stylesheet" type="text/css" href="css/taojin/priorityRole.css">

</head>
<body>
	<script type="text/javascript">
	
		$(function(){
			$("#edit-priorityRole-button").linkbutton({
				onClick:function(){
					var rId = $(".rolesRadio:checked").val();
					if (rId!=null ) {
						$.post('editPriorityRole',{rId:rId},function(data){
							if(data =='true'){
									$.messager.alert('提示','保存成功!');
									$('#role-addFunctions-dialog').dialog('close');
								}else{
									$.messager.alert('警告','添加失败!');
								}
							
						});
					}else{
						$.messager.alert('提示',"请选择您的最优角色!");
					}
				}
			});
			
		})
	
		
	</script>
	<div id="edit-priorityRole-layout" class="easyui-layout" data-options="fit:true,border:false" >
		<div data-options="region:'center'">
			<div style="height: 280px;width: 480px;border: 1px solid white;border-radius: 5px;margin-left: 200px;margin-top: 50px;padding: 10px 20px;">
				<div>
					<ul id="epr-ul" style="list-style: none;">
						<li>设置工作台优先角色</li>
						<li>您目前拥有以下几种角色，请选择一种作为优先角色:</li>
						<li style="padding-left: 0px;"> 
							<ul id="epr-roles-ul" style="list-style: none; height: 20px;">
								<c:forEach items="${roles}" var="r" varStatus="status">
									<li style="float: left;cursor: pointer;">
									<input id="${r.getRId()}" class="rolesRadio" type="radio" name="radio"  value="${r.getRId()}"/>
									<label for="${r.getRId()}" style="cursor: pointer;">${r.getRName()}</label>
									</li>
								</c:forEach>
							</ul> 
							<c:forEach items="${roles}" varStatus="status">
								<c:if test="${(status.index+1)%6==0}">
									<br />
								</c:if>
							</c:forEach>
						</li>
					</ul>
				</div>
					<div style="padding-left: 180px;padding-top: 70px;font-size:20px;">
					<a id="edit-priorityRole-button" class="easyui-linkbutton" 
					style="height: 40px;width: 100px;"
						data-options="text:'提交'"></a>
				</div>
			</div> 
   	    </div>
	</div>
</body>
</html>